﻿using System;

using Fuse8.DomainFramework.Domain;

using Fuse8.ContentManagementFramework.Domain.Commands.CommandParameters;

namespace Fuse8.ContentManagementFramework.Domain.Commands
{
    public abstract class CmsPageSelectFamilyPagesCommand : BaseEntityParameterCommand<CmsPage, CmsPageSelectFamilyPagesCommandParameter>
    {
        #region Overrides

        public override string CacheKey
        {
            get
            {
                return string.Format("IsInAdministration_{0};SiteGroup_{1};Site_{2};SystemLanguage_{3};PageId_{4};IsSearchParents_{5};WithStartPage_{6};MaxLevel_{7}",
                    CommandParameter.IsInAdministrationArea,
                    CommandParameter.SiteGroupId.GetValueOrDefault(0),
                    CommandParameter.SiteId.GetValueOrDefault(0),
                    CommandParameter.SystemLanguageId.GetValueOrDefault(0),
                    CommandParameter.Id,
                    CommandParameter.IsSearchParents,
                    CommandParameter.IncludeStartPage,
                    CommandParameter.PlusLevel.GetValueOrDefault(0));
            }
        }

        public override string CommandName
        {
            get
            {
                return "CmsPageSelectFamilyPagesCommand";
            }
        }

        #endregion
    }
}
